From 338290c3a13bd63b2a7ecf8e1e73b3e2db649b13 Mon Sep 17 00:00:00 2001 From: mseri Date: Sat, 29 Aug 2015 12:03:14 +0100 Subject: [PATCH] Added test for issue #1942 --- tests/test_cargo_run.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/test_cargo_run.rs b/tests/test_cargo_run.rs index 7d17d3843..90bb1313e 100644 --- a/tests/test_cargo_run.rs +++ b/tests/test_cargo_run.rs @@ -461,3 +461,27 @@ test!(dashes_are_forwarded { assert_that(p.cargo_process("run").arg("--").arg("a").arg("--").arg("b"), execs().with_status(0)); }); + +test!(run_from_executable_folder { + let p = project("foo") + .file("Cargo.toml", r#" + [project] + name = "foo" + version = "0.0.1" + authors = [] + "#) + .file("src/main.rs", r#" + fn main() { println!("hello"); } + "#); + + let cwd = p.root().join("target").join("debug"); + p.cargo_process("build").exec_with_output().unwrap(); + + assert_that(p.cargo("run").cwd(cwd), + execs().with_status(0).with_stdout(&format!("\ +{running} `./foo` +hello +", + running = RUNNING + ))); +}); -- 2.30.2